package token

// Type 词法几号类型
type Type int

// 词法记号类型
const (
	Plus  Type = iota // +
	Minus             // -
	Star              // *
	Slash             // /

	GE // >=
	GT // >

	Assignment // =

	Int

	Identifier //标识符

	IntLiteral //整型字面量
)

func (t Type) String() string {
	switch t {
	case Plus:
		return "Plus"
	case Minus:
		return "Minus"
	case Star:
		return "Star" // *
	case Slash:
		return "Slash" // /

	case Assignment:
		return "Assignment"

	case GE:
		return "GE" // >=
	case GT:
		return "GT" // >

	case Int:
		return "Int"

	case Identifier:
		return "Identifier" //标识符

	case IntLiteral:
		return "IntLiteral" //整型字面量
	default:
		return "unknown"
	}
}
